package ay.shadow.nacos.config;

import com.alibaba.cloud.nacos.NacosServiceManager;
import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.api.naming.NamingService;
import org.springframework.stereotype.Component;

import java.util.Properties;

import static com.alibaba.nacos.api.NacosFactory.createNamingService;

@Component
public class NacosServiceManagerV2 extends NacosServiceManager {

    public NamingService createNewNamingService(Properties properties) {
        try {
            return createNamingService(properties);
        }
        catch (NacosException e) {
            throw new RuntimeException(e);
        }
    }
}
